<template>
  <div class="view">
    <transition :name="transitionName">
      <router-view class="router_view"></router-view>
    </transition>
  </div>
</template>

<script>
export default {
  name: "myView",
  data() {
    return {
      transitionName: "slide-right",
    };
  },
  beforeRouteUpdate(to, from, next) {
    let isBack = this.$router.isBack;
    // console.log(this.$router.isBack)
    if (isBack) {
      this.transitionName = "slide-right";
    } else {
      this.transitionName = "slide-left";
    }
    this.$router.isBack = false;
    next();
  },
};
</script>

<style lang="less" scoped>

</style>